package com.edu.exam.enums.grading;

/**
 * 审计节点优先级枚举
 */
public enum AuditNodePriority {
    LOW("LOW", "低优先级"),
    NORMAL("NORMAL", "普通优先级"),
    HIGH("HIGH", "高优先级"),
    URGENT("URGENT", "紧急"),
    CRITICAL("CRITICAL", "关键");

    private final String code;
    private final String description;

    AuditNodePriority(String code, String description) {
        this.code = code;
        this.description = description;
    }

    public String getCode() {
        return code;
    }

    public String getDescription() {
        return description;
    }

    public static AuditNodePriority fromCode(String code) {
        for (AuditNodePriority priority : values()) {
            if (priority.getCode().equals(code)) {
                return priority;
            }
        }
        throw new IllegalArgumentException("Unknown audit node priority code: " + code);
    }

    @Override
    public String toString() {
        return description;
    }
}